package yz.com.cn.sort.core;

import lombok.Data;

/**
 * 冒泡排序
 *
 * @author zhoujian
 */
@Data
public class BubblingSort {
    private Integer[] arr;

    public void sort() {
        for (int i = 0; i < arr.length; i++) {
            for (int j = i + 1; j < arr.length; j++) {
                if (arr[i] > arr[j]) {
                    int temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }
            }
        }
    }
}
